﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manageweb/MemberMaster.master"
    AutoEventWireup="true" CodeFile="StockBalance.aspx.cs" Inherits="Manageweb_Stock_StockBalance" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>交易结存</title>
    <link href="../images/css.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript">dateFormat='yyyy-mm-dd'</script>

    <script src="../../js/popcalendar.js" type="text/javascript"></script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

<table style="margin: 0 auto;">
        <tr>
            <td style="background-color: #507CD1; font-weight: bold; color: White; text-align:left;">
                &nbsp; 交易结存</td>
        </tr>
        <tr>
        <td style="text-align:left">
          <table style="display:none">
               <tr><td>开始日期:</td><td>
                   <asp:TextBox ID="txtBeginDate" runat="server"></asp:TextBox>   <img   style="cursor:hand;" src="../../js/img/calendar.gif"
     onclick='popUpCalendar(this,   <%=txtBeginDate.ClientID %>, dateFormat,-1,-1)' 
     alt='Select'></td></tr>
                <tr><td>截止日期:</td><td>
                    <asp:TextBox ID="txtEndDate" runat="server"></asp:TextBox>   <img   style="cursor:hand;" src="../../js/img/calendar.gif"
     onclick='popUpCalendar(this,   <%=txtEndDate.ClientID %>, dateFormat,-1,-1)' 
     alt='Select'></td></tr>
                <tr><td>&nbsp;</td><td>
                    <asp:Button ID="btnQuery" runat="server" onclick="btnQuery_Click" Text="查询" />
                    </tr>
              </table>
        </td>
        </tr>
        
        <tr>
            <td>
                <asp:GridView ID="GV_StockBalance" runat="server" AllowPaging="True" AllowSorting="True"
                    AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" Width="800px"
                    EmptyDataText="暂无转出记录" OnPageIndexChanging="GV_StockBalance_PageIndexChanging"
                    PageSize="20" onrowdatabound="GV_StockBalance_RowDataBound" 
                    ShowFooter="True">
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <RowStyle BackColor="#EFF3FB" />
                    <Columns>
                        <asp:BoundField DataField="createtime" HeaderText="日期时间">
                            <ItemStyle Width="120px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="holdday" HeaderText="持有日">
                            <ItemStyle Width="100px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="buycount" HeaderText="自购股票">
                            <ItemStyle HorizontalAlign="Right" Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="daigu" HeaderText="待估股份" />
                        <asp:BoundField DataField="salecount" HeaderText="出售股份" />
                        <asp:BoundField DataField="holdcount" HeaderText="股份余额" />
                        <asp:BoundField DataField="unitprice" HeaderText="购买金额" 
                            DataFormatString="{0:F2}" />
                        <asp:TemplateField HeaderText="成本核算">                           
                            <ItemTemplate>
                            <asp:Label runat="server" ID="lblChengBen" Text=' <%#( Convert.ToDecimal(Eval("holdcount"))*Convert.ToDecimal(Eval("unitprice"))).ToString("F2") %>'></asp:Label>
                             
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="shijia" HeaderText="时价" DataFormatString="{0:F2}" />
                        <asp:TemplateField HeaderText="利润">                            
                            <ItemTemplate>
                             <asp:Label runat="server" ID="lblLiRun" text='<%#(Convert.ToDecimal(Eval("shijia"))-( Convert.ToDecimal(Eval("unitprice"))* Convert.ToDecimal(Eval("holdcount")))).ToString("F2")  %>'></asp:Label>
                             
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#2461BF" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
            </td>
        </tr>
    </table>

</asp:Content>
